package com.kfd.demo.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JsonConvertUtil {
    public static String toJsonString(Object obj) throws JsonProcessingException {
        /* 转Json字符串 */
        ObjectMapper objectMapper = new ObjectMapper();
        return objectMapper.writeValueAsString(obj);
    }
}
